//package com.eastcom.groovy.task.taskdirector.temp
//import com.eastcom.groovy.config.GLExpress
//import com.eastcom.groovy.config.TaskConfig
//import com.eastcom.groovy.context.ServerContext
//import com.eastcom.groovy.context.TaskContext
//import com.eastcom.groovy.provider.DbContextProvider
//import com.eastcom.groovy.provider.DynamicBeanDomianProvider
//import com.eastcom.groovy.provider.SpringContextProvider
//import com.eastcom.groovy.task.Task
//import com.eastcom.groovy.tools.db.DbEngine
//import com.eastcom.groovy.tools.db.DbInfo
//import com.eastcom.groovy.tools.db.Table
//import com.eastcom.groovy.tools.file.ExcelReader
//import com.eastcom.groovy.tools.file.GroovyUtil
//import com.eastcom.groovy.tools.file.JaxbJavaUtilDateSerializer;
//import com.eastcom.groovy.tools.file.JaxbUtil
//import com.eastcom.groovy.tools.TaskUtil
//import com.sun.corba.se.spi.orbutil.fsm.Guard.Result;
//
//import org.apache.commons.logging.Log
//import org.apache.commons.logging.LogFactory
//import org.springframework.beans.factory.BeanFactory
//import org.springframework.beans.factory.support.BeanDefinitionRegistry
//import org.springframework.beans.factory.support.DefaultListableBeanFactory
//import org.springframework.beans.factory.xml.XmlBeanDefinitionReader
//import org.springframework.core.io.FileSystemResource
//import org.springframework.dao.DataAccessException
//import org.springframework.jdbc.core.ResultSetExtractor
//import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
//
//import java.io.BufferedReader;
//import java.io.File;
//import java.io.FileInputStream;
//import java.io.IOException;
//import java.io.InputStreamReader;
//import java.io.Serializable;
//import java.sql.CallableStatement
//import java.sql.Connection;
//import java.sql.DriverManager;
//import java.sql.ResultSet
//import java.sql.SQLException
//import java.sql.Statement;
//import java.sql.Timestamp
//import java.sql.Types
//import java.text.ParseException
//import java.text.SimpleDateFormat
//import java.util.ArrayList;
//import java.util.List;
//import java.util.Properties;
//import java.util.concurrent.ThreadPoolExecutor
//import java.util.regex.Matcher
//import java.util.regex.Pattern
//
//import javax.xml.bind.annotation.XmlAccessorType
//import javax.xml.bind.annotation.XmlElement
//import javax.xml.bind.annotation.XmlRootElement
//public boolean initJob(String jobId){
//}
//
///**
// * 鎵ц鏂规硶
// * @param jobId
// */
//public boolean doJob(String jobId) {
//	Log logger = LogFactory.getLog(this.class)
//	DbEngine dbEngine = SpringContextProvider.getBean("dbEngine")
//	dbEngine.getJdbcUtil().setDataSource(SpringContextProvider.getBean("oracle_39"))
////	File dirs = new File("/home/ipnet/mystope/data/M接口错误码统计小时报表");
//	File dirs = new File("E:\\ftpfile\\mmse.xls");
//	if(! dirs.isDirectory()){
//		logger.debug("inviland dir!");
//		return;
//	}
//	File[] f2 = dirs.listFiles(new FilenameFilter() {
//
//				@Override
//				public boolean accept(File dir, String name) {
//					// TODO 自动生成的方法存根
//					if(name.matches(".*\\d+\\.xls")){
//						logger.debug("recieve file:"+name);
//						return true;
//					}
//					return false;
//				}
//			});
//	if(f2 == null){
//		logger.debug("not any file of regex name found!");
//		return;
//	}
//	println "dfdfdfd"+f2
//	Calendar fileTime = Calendar.getInstance();
//	Calendar fileLimitTime = Calendar.getInstance();
//	long ft = 150000000;
//	fileLimitTime.setTimeInMillis(new Date().getTime() - ft);
//	List<List<String>> result
//	for(File file2: f2){
//		result = doQueryExcel(file2)
//	}
//
//	try {
//		if(!result.isEmpty()){
//			String sql = "insert into MMS_DINGZHI_IFMERRCODE_HOUR(TIMESTAMP,ERRORCODE,ERRORCOUNT) values(?,?,?)"
//			for(List<String> raw: result){
//				List<Object> param = new ArrayList()
//				SimpleDateFormat sim = new SimpleDateFormat("YYYMMDDHHSS")
//				Timestamp ti = new Timestamp(sim.parse(raw.get(0)))
//				Integer errorCode = Integer.valueOf(raw.get(1))
//				Integer errorNum = Integer.valueOf(raw.get(2))
//				param.add(ti)
//				param.add(errorCode)
//				param.add(errorNum)
//				dbEngine.getJdbcUtil().batchUpdate(sql, param)
//			}
//		}
//	} catch (ParseException e) {
//		// TODO 自动生成的 catch 块
//		e.printStackTrace();
//	}
//}
//
//
//public List<List<String>> doQueryExcel(File fl){
//	StringBuffer sqlBuffer = new StringBuffer();
//	String fileName = fl.getName();
//	List<List<String>> tempResult = new ArrayList()
//	List<List<String>> resultList = new ArrayList()
//	ExcelReader excelReader = new ExcelReader();
//	List<String[]> fileContext = excelReader.readExcelContent(new FileInputStream(fl));
//	fileContext.each {
//		List<String> raw = new ArrayList()
//		it.each {
//			raw.add(it)
//		}
//		tempResult.add(raw)
//	}
//	List<String> time = tempResult.get(2).subList(1, tempResult.get(2).size())
//	for(int i = 1; i < time.size()+1; i++){
//		String t = time.get(i-1)
//		for(int n = 3; n < tempResult.size(); n ++){
//			List<String> raw = tempResult.get(n)
//			resultList.add(t)
//			for(int j = 0; j < i; j++){
//				resultList.add(raw.get(j))
//			}
//		}
//		
//	}
//	return resultList
////	for(int i = 3; i < tempResult.size(); i++){
////		time.each {
////			List<String> raw = new ArrayList()
////			raw.add(it)
////			resultList.add(raw)
////			tempResult.get(i).e
////		}
////	}
//
//	//	for(int i = 0; i < tempResult){
//	//
//	//	}
//	return resultList
//}
//
